package com.tulele.vtool.wechat.builder;

import com.tulele.vtool.wechat.service.WeixinService;
import com.tulele.vtool.wechat.service.WeixinServiceDL;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutImageMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;

public class ImageBuilder extends AbstractBuilder {

    //改支持多公众号之前
//    @Override
//    public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage,
//                                   WeixinService service) {
//
//        WxMpXmlOutImageMessage m = WxMpXmlOutMessage.IMAGE().mediaId(content)
//                .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
//                .build();
//
//        return m;
//    }

    //改支持多公众号之后
    @Override
    public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage,
                                   WeixinServiceDL service) {

        WxMpXmlOutImageMessage m = WxMpXmlOutMessage.IMAGE().mediaId(content)
                .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
                .build();

        return m;
    }

}
